#ifndef FILE_H
#define FILE_H

#include <string>
#include <fstream>
#include "StringUtil.h"

class File
{
	private:
		std::ifstream m_file;
		std::string m_name;
		int m_currentLine;

	public:
		File():m_currentLine(0){}
		bool IsOpen() const{return m_file.is_open();}
		const std::string& GetFileName() const{return m_name;}
		int GetCurrentLine() const{return m_currentLine;}
		std::string GetCurrentLineStr();
		bool OpenRead(const std::string& filename);
		bool GetInteger(int* intResult);
		bool GetFloat(float* floatResult);
		bool GetString(std::string* stringResult);
		bool GetBool(bool* boolResult);
		bool End() const{return m_file.eof();}
		void Close();

		void ReportFileError(std::string& msg);
		~File();
};

#endif